package com.java.demo.service;

import com.java.demo.dao.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2023-07-22
 * Time: 10:47
 */
@Service
public class UserService4 {

    private UserRepository userRepository;
   // @Autowired
        public UserService4(UserRepository userRepository) {
        this.userRepository = userRepository;
    }
    public void sayHi(){
        System.out.println("执行UserService方法");
        userRepository.add();
    }
}
